import { createApp } from "vue";
import App from "@/App.vue";

import "@/styles/index.scss";
import svgPlugin from "@/plugins/svgPlugin";

import ElementPlus from "element-plus";
import zhCn from "element-plus/es/locale/lang/zh-cn";
import "element-plus/dist/index.css";
import "element-plus/theme-chalk/dark/css-vars.css";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";

import router from "@/router";
import { createPinia } from "pinia";
import { hasButton } from "./directive/has";

import "default-passive-events";

const pinia = createPinia();
const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

app.use(pinia);
app.use(router);
app.use(svgPlugin);
app.use(ElementPlus, { locale: zhCn });

hasButton(app);
app.mount("#app");
